package ch03.shiLi.shiLi9;

import net.sf.cglib.proxy.Callback;
import net.sf.cglib.proxy.Enhancer;

public class IntermediaryCglibProxyFactory {
    private static IntermediaryMethodterceptor callback= new IntermediaryMethodterceptor();

   public static  <T> T create(Class<T> target) {
       Enhancer enhancer = new Enhancer();
       enhancer.setCallback(callback);
       enhancer.setSuperclass(target);
       return (T) enhancer.create();
   }
}
